package com.cn.xiaonuo.slbfinances.slexapply.controller;

import com.cn.xiaonuo.common.entity.BusinessMessage;
import com.cn.xiaonuo.slbfinances.slexapply.service.IExApplyBuyService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
public class ExApplyBuyController {
    @Resource
    private IExApplyBuyService iExApplyBuyService;

    @ApiOperation(value = "文交记录查询--内盘查询--用户实名制--数据列表", notes = "文交记录查询--内盘查询--用户实名制--数据列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userReal_id", value = "当前登录用户id(Integer)", required = true),
            @ApiImplicitParam(name = "userReal_name", value = "真实姓名"),
            @ApiImplicitParam(name = "userReal_phone", value = "手机号码"),
            @ApiImplicitParam(name = "check_state", value = "状态"),
            @ApiImplicitParam(name = "shop_name", value = "店铺名称"),
            @ApiImplicitParam(name = "shop_id", value = "店铺id"),
            @ApiImplicitParam(name = "needPage", value = "1 不分页"),
            @ApiImplicitParam(name = "pageNo", value = "页数", required = true),
            @ApiImplicitParam(name = "pageSize", value = "长度", required = true)
    })
    @RequestMapping(value = "api/exapplybuy/queryRealUser", method = RequestMethod.POST)
    public BusinessMessage queryRealUser(String userReal_id, String userReal_name, String userReal_phone, String check_state, String shop_name, String shop_id, Integer pageNo, Integer pageSize, String needPage) {
        return iExApplyBuyService.queryRealUser(userReal_id, userReal_name, userReal_phone, check_state, shop_name, shop_id, pageNo, pageSize, needPage);
    }

    @ApiOperation(value = "文交记录查询--内盘查询--用户实名制--添加用户/编辑用户", notes = "文交记录查询--内盘查询--用户实名制--添加用户/编辑用户")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "login_user_id", value = "当前登录用户id(Integer)", required = true),
            @ApiImplicitParam(name = "apply_user_id", value = "申请用户id(Integer)", required = true),
            @ApiImplicitParam(name = "real_name", value = "真实姓名"),
            @ApiImplicitParam(name = "identity_card", value = "身份证号码"),
            @ApiImplicitParam(name = "bank_card", value = "银行卡号"),
            @ApiImplicitParam(name = "open_branch_bank", value = "开户支行"),
            @ApiImplicitParam(name = "hand_identity_card_image", value = "手持身份证"),
            @ApiImplicitParam(name = "pageNo", value = "页数", required = true),
            @ApiImplicitParam(name = "pageSize", value = "长度", required = true)
    })
    @RequestMapping(value = "api/exapplybuy/addRealUser", method = RequestMethod.POST)
    public BusinessMessage addRealUser(String login_user_id,
                                       String apply_user_id,
                                       String real_name,
                                       String identity_card,
                                       MultipartFile hand_identity_card_image,
                                       String bank_card,
                                       String open_branch_bank,
                                       String bankCode,
                                       String bankAcctType,
                                       String provCode,
                                       String areaCode,
                                       String reservePhone
    ) {
        return iExApplyBuyService.addRealUser(login_user_id,
                apply_user_id,
                real_name,
                identity_card,
                hand_identity_card_image,
                bank_card,
                open_branch_bank,
                bankCode,
                bankAcctType,
                provCode,
                areaCode,
                reservePhone);
    }


    @ApiOperation(value = "文交记录查询--内盘查询--用户实名制--拒绝/通过", notes = "文交记录查询--内盘查询--用户实名制--拒绝/通过")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "check_userReal_id", value = "用户id(Integer)", required = true),
            @ApiImplicitParam(name = "check_check_state", value = "状态(Integer)", required = true),
    })
    @RequestMapping(value = "api/exapplybuy/checkRealUser", method = RequestMethod.POST)
    public BusinessMessage checkRealUser(Integer check_userReal_id, Integer check_check_state) {
        return iExApplyBuyService.checkRealUser(check_userReal_id, check_check_state);
    }


    @ApiOperation(value = "文交记录查询--内盘查询--文交商城赠送酒交易明细-废弃（表已被清理）", notes = "文交记录查询--内盘查询--文交商城赠送酒交易明细废弃（表已被清理）")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wjs_user_id", value = "文交所用户ID(Integer)"),
            @ApiImplicitParam(name = "user_id", value = "用户id(Integer)"),
            @ApiImplicitParam(name = "user_phone", value = "用户电话"),
            @ApiImplicitParam(name = "user_name", value = "用户昵称"),
            @ApiImplicitParam(name = "aging_or_not", value = "是否分页，0代表不分页，1代表分页"),
            @ApiImplicitParam(name = "open_branch_bank", value = "开户支行"),
            @ApiImplicitParam(name = "hand_identity_card_image", value = "手持身份证"),
            @ApiImplicitParam(name = "pageNo", value = "页数", required = true),
            @ApiImplicitParam(name = "pageSize", value = "长度", required = true)
    })
    @RequestMapping(value = "api/exapplybuy/queryUserWine", method = RequestMethod.POST)
    public BusinessMessage queryUserWine(String wjs_user_id,
                                         String user_id,
                                         String user_phone,
                                         String user_name,
                                         Integer aging_or_not,
                                         Integer pageNo,
                                         Integer pageSize) {
        return iExApplyBuyService.queryUserWine(wjs_user_id, user_id, user_phone, user_name, aging_or_not, pageNo, pageSize);
    }


    @ApiOperation(value = "文交记录查询--内盘查询--求购转让记录", notes = "文交记录查询--内盘查询--求购转让记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "consigneeName", value = "收货人"),
            @ApiImplicitParam(name = "remark", value = "购买类型1,直接购买2,求购"),
            @ApiImplicitParam(name = "payment_state", value = "支付状态"),
            @ApiImplicitParam(name = "id", value = "订单编号"),
            @ApiImplicitParam(name = "startTime", value = "开始时间"),
            @ApiImplicitParam(name = "endTime", value = "结束时间"),
            @ApiImplicitParam(name = "user_id", value = "订单创建人ID"),
            @ApiImplicitParam(name = "serial_number", value = "订单序列号"),
            @ApiImplicitParam(name = "startConfirmTime", value = "确认收货开始时间"),
            @ApiImplicitParam(name = "endConfirmTime", value = "确认收货结束时间"),
            @ApiImplicitParam(name = "flg", value = "支付是否使用了积分或者SLB"),
            @ApiImplicitParam(name = "isFirst", value = "是否查询当日新订单"),
            @ApiImplicitParam(name = "pageNo", value = "页数", required = true),
            @ApiImplicitParam(name = "pageSize", value = "长度", required = true)
    })
    @RequestMapping(value = "api/exapplybuy/purchaseTransferRecord", method = RequestMethod.POST)
    public BusinessMessage purchaseTransferRecord(Integer pageNo,
                                                  Integer pageSize,
                                                  String consigneeName,
                                                  String remark,
                                                  String payment_state,
                                                  String id,
                                                  String startTime,
                                                  String endTime,
                                                  String user_id,
                                                  String serial_number,
                                                  String startConfirmTime,
                                                  String endConfirmTime,
                                                  Integer flg,
                                                  Integer isFirst) {
        return iExApplyBuyService.purchaseTransferRecord(pageNo, pageSize, consigneeName, remark, payment_state, id, startTime, endTime, user_id, serial_number, startConfirmTime, endConfirmTime, flg, isFirst);
    }


}
